<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 后台管理员</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="__STATIC__/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="__STATIC__/layuiadmin/style/admin.css" media="all">
  <style>
    .layui-form-select dl{ max-height: 200px; }
  </style>
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">

  <div class="layui-form-item">
    <label class="layui-form-label">目录名称</label>
    <div class="layui-input-inline">
      <input type="text" name="name" lay-verify="required" placeholder="目录名称" autocomplete="off" class="layui-input" value="{$data['name']}">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">应用目录</label>
    <div class="layui-input-inline">
      <input type="hidden" name="id"   value="{$data['id']}">
      <input type="text" name="app" lay-verify="required" placeholder="应用目录" autocomplete="off" class="layui-input" value="{$data['app']}">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">控制器</label>
    <div class="layui-input-inline">
      <input type="text" name="controller" lay-verify="required" placeholder="控制器" autocomplete="off" class="layui-input" value="{$data['controller']}">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">方法</label>
    <div class="layui-input-inline">
      <input type="text" name="action" lay-verify="required" placeholder="方法" autocomplete="off" class="layui-input" value="{$data['action']}">
      <input type="hidden" name="remark"  value="{$data['remark']}">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">图标</label>
    <div class="layui-input-inline">
      <input type="text" name="icon"  placeholder="图标" autocomplete="off" class="layui-input" value="{$data['icon']}">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">图标库</label>
    <div class="layui-input-inline">
      <a class="layui-btn" id="sub" href="https://www.layui.com/doc/element/icon.html" target="_blank">图标库</a>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">上级目录</label>
    <div class="layui-input-inline">
      <select name="parent_id">

        {if condition="$data.parent_id eq 0"} //做比较，用获取到的值比较第二个值
          <option value="0" selected>顶级栏目</option>
          {volist name="menu_name" id="v"}
          <option value="{$v.id}">{$v.levelName} </option>
          {/volist}
        {else /}
          {volist name="menu_name" id="v"}
            {if condition="$v.id eq $data.parent_id"} //做比较，用获取到的值比较第二个值
                <option value="{$v.id}" selected>{$v.levelName}</option>
                <option value="0" >顶级栏目</option>
            {else /}
                <option value="{$v.id}">{$v.levelName} </option>
            {/if}

          {/volist}
        {/if}
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">审核状态</label>
    <div class="layui-input-inline">
      <input type="checkbox" lay-filter="switch" name="status" lay-skin="switch" lay-text="左侧显示|左侧不显示" {if $data['status'] == 1}checked {/if} >
    </div>
  </div>
  <div class="layui-form-item layui-hide">
    <input type="button" lay-submit lay-filter="LAY-add-route-submit" id="LAY-add-route-submit" value="确认">
  </div>
</div>


 <script src="__STATIC__/layuiadmin/layui/layui.js"></script>
  <script>
  layui.config({
    base: '__STATIC__/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'table'], function(){
    var $ = layui.$
    ,form = layui.form
    ,table = layui.table;


    $("#sub").hover(function() {
      openMsg();
    }, function() {
      layer.close(subtips);
    });
    function openMsg() {
      subtips = layer.tips('不知道图标用啥，点这里', '#sub',{tips:[1,'#ff6700'],time: 30000});
    }













  });
  </script>
</body>
</html>

